import _ from 'lodash'
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';

import './style/common.scss'
import './style/element-variables.scss'
import Theme from "./untils/theme";
var VueTouch = require('vue-touch')


import clipboard from 'clipboard';
import './permission'
import * as custom from '@/filter'

import VueRouter from 'vue-router';
if (VueRouter.version > '3.1') {
    const routerPush = VueRouter.prototype.push
    VueRouter.prototype.push = function push (location) {
        return routerPush.call(this, location).catch(error => error)
    }
}


Theme.SetTheme(window.localStorage.getItem("theme"));
Vue.config.productionTip = false

Vue.prototype.clipboard = clipboard;

Vue.use(_);
Vue.use(VueTouch, {name: 'v-touch'})
Vue.use(Element, {
		size: 'large',
		zIndex: 9999
})

// 全局过滤器文件
Object.keys(custom).forEach(key => {
    Vue.filter(key, custom[key])
})

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')
